import {computed} from "vue";
import WordIcon from "@/components/document/WordIcon";
import PptIcon from "@/components/document/PptIcon";
import PdfIcon from "@/components/document/PdfIcon";
import ExcelIcon from "@/components/document/ExcelIcon";
import JpgIcon from "@/components/document/JpgIcon";
import XmindIcon from "@/components/document/XmindIcon";
import MdIcon from "@/components/document/MdIcon";
import TxtIcon from "@/components/document/TxtIcon";
import HexIcon from "@/components/document/HexIcon";
import Mp4Icon from "@/components/document/Mp4Icon";
import UnknownIcon from "@/components/document/UnknownIcon";


export default function useComputedFileType() {
   return computed(() => {
        return (type) => {
            const typeMap = {
                'doc': WordIcon,
                'docx': WordIcon,
                'ppt': PptIcon,
                'pptx': PptIcon,
                'pdf': PdfIcon,
                'xls': ExcelIcon,
                'xlsx': ExcelIcon,
                'jpg': JpgIcon,
                'png': JpgIcon,
                'jpeg': JpgIcon,
                'xmind': XmindIcon,
                'md': MdIcon,
                'txt': TxtIcon,
                'hex': HexIcon,
                'mp4': Mp4Icon
            }
            return typeMap[type.toLowerCase()] || UnknownIcon
        }
    })
}
